home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / PROGNG_C / TCHK060.LZH / VIDEO.H < prev   
C/C++ Source or Header  |  1988-01-15  |  3KB  |  75 lines

  1. /* TCHK 0.60 - Howard Kapustein's Turbo C library      1-15-88 */
  2. /* Copyright (C) 1988, Howard Kapustein.  All rights reserved. */
  3.  
  4. /* video.h  -  header file for VIDEO.C - screen output routines */
  5.  
  6. #include <howard.h>
  7.  
  8. #ifndef VIDEO
  9. #define VIDEO     0x10           /* VIDEO INTerrupt service = 16 (HEX 10) */
  10. #define MODE      *((byte far *) 0x449lu)          /* current video mode */
  11. #define PAGE      *((byte far *) 0x462lu)          /* current display page */
  12. #define PAGELEN   *((unsigned int far *) 0x44Clu)  /* current page length (regen buffer) */
  13. #define VIDOFFSET *((unsigned int far *) 0x44Elu)  /* offset from start of video */
  14. #define ROWCOUNT  *((byte far *) 0x484lu)          /* # rows minus 1 on display (EGA,PGA) */
  15. #define CHARHEIGHT *((unsigned int far *) 0x485lu) /* character height: # bytes/char, # scan lines/char (EGA,PGA) */
  16. #define CURSOR_UNDERBAR   (MODE==7)?0x0B0C:0x0607  /* cursor type: underbar (default) */
  17. #define CURSOR_HALFBLOCK  (MODE==7)?0x070C:0x0407  /* cursor type: half-block */
  18. #endif
  19.  
  20. /* Global variables */
  21. /* These have already been defined, they are just listed here for your
  22.    reference. Do not uncomment these variables.
  23.  
  24.    byte frame1[9] = {'┌','─','┐','│','┘','─','└','│','\0'};
  25.    byte frame11[5] = {'┬','├','┴','┤','┼'};
  26.    byte frame12[6] = {'╓','╞','╨','╡','╫','╪'};
  27.    byte frame2[9] = {'╔','═','╗','║','╝','═','╚','║','\0'};
  28.    byte frame21[6] = {'╤','╟','╧','╢','╪','╫'};
  29.    byte frame22[5] = {'╦','╠','╩','╣','╬'};
  30.    byte frame0[9] = {' ',' ',' ',' ',' ',' ',' ',' ','\0'};
  31. */
  32.  
  33. /* function prototypes */
  34. void cls(void);
  35. void clear(int top, int left, int bottom, int right);
  36. void gotoxy(int x, int y);
  37. byte wherex(void);                /* returns X-coord of cursor */
  38. byte wherey(void);                /* returns Y-coord of cursor */
  39. byte whatxy(byte *attrib);        /* read character/attribute at cursor */
  40. void read_mode(byte *width, byte *mode, byte *page);
  41. void set_mode(byte mode);
  42. int box(int top, int left, int bottom, int right, byte frame[]);
  43. void horiz_line(byte c, unsigned int len, byte row, byte col);
  44. void vert_line(byte c, unsigned int len, byte row, byte col);
  45. void putk(byte c);
  46. void putstr(byte *c);             /* INTerrupt output */
  47. void putsay(byte row, byte col, byte *c);        /* direct screen writes */
  48. unsigned int read_cursor(byte *row, byte *col);    /* returns CX reg, scan lines */
  49. void set_cursor(byte start, byte end);      /* set cursor scan lines */
  50. void cursor_off(void);
  51. void cursor_on(void);
  52. void cursor_flip(unsigned int curs1, unsigned int curs2);   /* toggle cursor type */
  53. void cursor_blink(boolean fast);
  54. void set_color(byte colors);
  55. boolean isMDA(void);
  56. boolean isHerc(void);
  57. boolean isEGA(void);
  58. boolean isCGA(void);
  59. void save_screen(byte *buffer);           /* saves screen to buffer */
  60. void save_box(byte top, byte left, byte bottom, byte right, byte *buffer);
  61. void restore_screen(byte *buffer);   /* restores screen from buffer */
  62. void restore_box(byte top, byte left, byte bottom, byte right, byte *buffer);
  63. void scroll_up(byte top, byte left, byte bottom, byte right);
  64. void scroll_down(byte top, byte left, byte bottom, byte right);
  65.  
  66.  
  67. #ifndef ismono()
  68. #define ismono()   isMDA()|isHerc()
  69. #define iscolor()  !ismono()
  70. #endif
  71.  
  72. #ifndef scrbuff()
  73. #define scrbuff(t,l,b,r)    (b-t+1)*(r-l+1)*2
  74. #endif
  75.